package boot.mq.rabbitmq.consumer.process;

import boot.mq.rabbitmq.core.RabbitmqTopicConstant;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
//@RabbitListener(queues = RabbitmqTopicConstant.Vacation_Process_Apply)
public class VacationProcessConsumer {
    @RabbitHandler
    @RabbitListener(queues = RabbitmqTopicConstant.Vacation_Process_Apply)
    public void vacationProcessApplyHandler(Map message) {
        String msg=String.format("收到 %s 消息：%s", RabbitmqTopicConstant.Vacation_Process_Apply,message.toString());
        System.out.println(msg);
    }

    @RabbitHandler
    @RabbitListener(queues = RabbitmqTopicConstant.Vacation_Process_Confirm)
    public void vacationProcessConfirmHandler(Map message) {
        String msg=String.format("收到 %s 消息：%s", RabbitmqTopicConstant.Vacation_Process_Confirm,message.toString());
        System.out.println(msg);
    }
}
